Displaying just one column means pages are arranged vertically
authorJonas Bernoulli <jonas@bernoul.li>
Thu, 4 Aug 2022 12:05:07 +0000 (14:05 +0200)
committerJonas Bernoulli <jonas@bernoul.li>
Thu, 4 Aug 2022 12:05:07 +0000 (14:05 +0200)
Third-party display methods may do that without using a side-window,
and therefore they don't set `which-key-popup-type' to `side-window'.
Likewise they might not set `which-key-side-window-location', e.g.,
because their display method only supports one location.

`which-key-max-display-columns' being 1 is by itself already enough
of an indicator to know that there won't be multiple columns.

which-key.el

index d9dcf8dee9a4985bb8b42c9bbed63ff195144426..89bdbe864576be845411089b541e0702ce191dec 100644 (file)
@@ -1972,8 +1972,9 @@ is the width of the live window."
          (avl-lines (if prefix-top-bottom (- max-lines 1) max-lines))
          (min-lines (min avl-lines which-key-min-display-lines))
          (avl-width (if prefix (- max-width prefix) max-width))
-         (vertical (and (eq which-key-popup-type 'side-window)
-                        (member which-key-side-window-location '(left right))))
+         (vertical (or (and (eq which-key-popup-type 'side-window)
+                            (member which-key-side-window-location '(left right)))
+                      (eq which-key-max-display-columns 1)))
          result)
     (setq result
           (which-key--create-pages-1